﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace UI.Forms
{
    public partial class Emp_pwd : FormBase1
    {
        private SVC.client.Employee emp;
        public Emp_pwd(SVC.client.Employee _emp)
        {
            InitializeComponent();
            emp = _emp;
        }

        private void Emp_U_Load(object sender, EventArgs e)
        {
            te_code.Text = emp.EmpCode;
            te_name.Text = emp.EmpName;

        }

        private void btn_new_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (dxValidationProvider1.Validate())
            {
                SVC.client.Employee emp = new SVC.client.Employee();
                emp.PassWord = MyEncrypt.MD5Encrypt(te_mm1.Text);
                string r = my.bw.Employee_Update(emp, my.ACID);
                if (string.IsNullOrEmpty(r))
                {
                    Comm.ShowInfo("修改密码成功！");
                    this.Close();
                }
                else
                {
                    Comm.ShowErorr(r);
                }
            }
        }


    }
}